 <template>
	<view class="container">
		<cu-custom bgColor="bg-gradual-green" :isBack="true">
			<block slot="backText">返回</block>
			<block slot="content">设置</block>
		</cu-custom>
		
		
		<view class="list-cell m-t" @click="jump" data-src="/pagesA/chg_pwd/chg_pwd">
			<text class="cell-tit">修改密码</text>
		</view>
		<view class="list-cell m-t">
			<text class="cell-tit">清除缓存</text>
		</view>
		
		<button class="cu-btn bg-gradual-green margin-tb-sm lg" style="width: 700upx;margin: 25upx;" @click="toLogout">退出登录</button>
		
	</view>
</template>

<script>
	import {  
	    mapMutations  
	} from 'vuex';
	export default {
		data() {
			return {
				openid:'',
				res:[],
			};
		},
		onLoad() {
			uni.getStorage({
			key: 'openid',
			success: (res) => {
				 this.openid = res.data
				 // this.setAjax()
				},
			});
		},
		methods:{
			setAjax() {},
			jump(e){
				uni.navigateTo({
					url: e.currentTarget.dataset.src
				});
			},
			// 退出登录
			toLogout(){
				uni.showModal({
					content: "是否退出登录?",
					confirmText: "确定",
					cancelText: "取消",
					success: res => {
						if(res.confirm){
							uni.reLaunch({
								url: '/pagesA/login/login'
							})
							uni.clearStorageSync()
						}
					}
				})
			},
			

		}
	}
</script>

<style lang='scss'>
	page{
		background: $page-color-base;
	}
	.list-cell{
		display:flex;
		align-items:baseline;
		padding: 20upx $page-row-spacing;
		line-height:60upx;
		position:relative;
		background: #fff;
		justify-content: center;
		&.log-out-btn{
			margin-top: 40upx;
			.cell-tit{
				color: #000;
				text-align: center;
				margin-right: 0;
			}
		}
		&.cell-hover{
			background:#fafafa;
		}
		&.b-b:after{
			left: 30upx;
		}
		&.m-t{
			margin-top: 16upx; 
		}
		.cell-more{
			align-self: baseline;
			font-size:$font-lg;
			color:$font-color-light;
			margin-left:10upx;
		}
		.cell-tit{
			flex: 1;
			font-size: $font-base + 2upx;
			color: $font-color-dark;
			margin-right:10upx;
		}
		.cell-tip{
			font-size: $font-base;
			color: $font-color-light;
		}
		switch{
			transform: translateX(16upx) scale(.84);
		}
	}
</style>
